<?php

use Phinx\Migration\AbstractMigration;
use Phinx\Db\Adapter\MysqlAdapter;

class UserCertification extends AbstractMigration
{
    public function up()
    {
        $table = $this->table('user_certification', array('comment' => '会员认证信息表'));
        $table
              ->addColumn('camp_id', 'integer', array('comment' => '营地id','null' => true,'limit' => MysqlAdapter::INT_TINY))
              ->addColumn('account', 'string', array('comment' => '会员账号','limit' => 255,'null' => true))
              ->addColumn('user_id', 'integer', array('comment' => '会员id','null' => true,'limit' => MysqlAdapter::INT_TINY))
              ->addColumn('name', 'string', array('limit' => 255,'comment' => '会员姓名','null' => true))
              ->addColumn('card_id', 'string', array('comment' => '身份证号','null' => true))
              ->addColumn('card_pic_z', 'string', array('limit' => 255,'comment' => '身份证号正面照片','null' => true))
              ->addColumn('card_pic_f', 'string', array('limit' => 255,'comment' => '身份证号反面照片','null' => true))
              ->addColumn('created_at', 'timestamp', array('default' => 'CURRENT_TIMESTAMP'))
              ->addColumn('updated_at', 'timestamp', array('null' => true))
              ->save();     
    }
    /**
     * Migrate Down.
     */
    public function down()
    {
        $this->dropTable('user_certification');
    }
}
